<?xml version="1.0" encoding="utf-8"?>
<!--
                                                                                     
 h       t     t                ::       /     /                     t             / 
 h       t     t                ::      //    //                     t            // 
 h     ttttt ttttt ppppp sssss         //    //  y   y       sssss ttttt         //  
 hhhh    t     t   p   p s            //    //   y   y       s       t          //   
 h  hh   t     t   ppppp sssss       //    //    yyyyy       sssss   t         //    
 h   h   t     t   p         s  ::   /     /         y  ..       s   t    ..   /     
 h   h   t     t   p     sssss  ::   /     /     yyyyy  ..   sssss   t    ..   /     
                                                                                     
	<https://y.st./>
	Copyright © 2017 Alex Yst <mailto:copyright@y.st>

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <https://www.gnu.org./licenses/>.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="https://y.st./en/weblog/2017/06-June/05.xhtml" />
		<title>I thought I was done, but I am not. &lt;https://y.st./en/weblog/2017/06-June/05.xhtml&gt;</title>
		<link rel="icon" type="image/png" href="/link/CC_BY-SA_4.0/y.st./icon.png" />
		<link rel="stylesheet" type="text/css" href="/link/basic.css" />
		<link rel="stylesheet" type="text/css" href="/link/site-specific.css" />
		<script type="text/javascript" src="/script/javascript.js" />
		<meta name="viewport" content="width=device-width" />
	</head>
	<body>
		<nav>
			<p>
				<a href="/en/">Home</a> |
				<a href="/en/a/about.xhtml">About</a> |
				<a href="/en/a/contact.xhtml">Contact</a> |
				<a href="/a/canary.txt">Canary</a> |
				<a href="/en/URI_research/"><abbr title="Uniform Resource Identifier">URI</abbr> research</a> |
				<a href="/en/opinion/">Opinions</a> |
				<a href="/en/coursework/">Coursework</a> |
				<a href="/en/law/">Law</a> |
				<a href="/en/a/links.xhtml">Links</a> |
				<a href="/en/weblog/2017/06-June/05.xhtml.asc">{this page}.asc</a>
			</p>
			<hr/>
			<p>
				Weblog index:
				<a href="/en/weblog/"><abbr title="American Standard Code for Information Interchange">ASCII</abbr> calendars</a> |
				<a href="/en/weblog/index_ol_ascending.xhtml">Ascending list</a> |
				<a href="/en/weblog/index_ol_descending.xhtml">Descending list</a>
			</p>
			<hr/>
			<p>
				Jump to entry:
				<a href="/en/weblog/2015/03-March/07.xhtml">&lt;&lt;First</a>
				<a rel="prev" href="/en/weblog/2017/06-June/04.xhtml">&lt;Previous</a>
				<a rel="next" href="/en/weblog/2017/06-June/06.xhtml">Next&gt;</a>
				<a href="/en/weblog/latest.xhtml">Latest&gt;&gt;</a>
			</p>
			<hr/>
		</nav>
		<header>
			<h1>I thought I was done, but I am not.</h1>
			<p>Day 00821: Monday, 2017 June 05</p>
		</header>
<section id="general">
	<h2>General news</h2>
	<p>
		<code>cheapie</code> on <a href="ircs://freenodeok2gncmy.onion:6697/%23Minetest">#Minetest</a> told me about <code>minetest.get_dir_list()</code>, a function that&apos;ll get me the list of database files to convert all at once!
		I still need a way to delete the old files, but that&apos;s less important.
		The <code>Settings(file_name):remove(key)</code> method is supposed to delete a key/value pair from the file, but it seems to be no-op, or something.
		I was going to remove each key/value pair as I finished with it.
		I ended up having to use <code>io.open(file_name, "w"):close()</code> at the end to erase everything at once instead.
		Either way, it accomplishes the same task though: removing the key/value pairs so they won&apos;t be re-imported a second time.
	</p>
	<p>
		I thought I&apos;d finished up the mod today, but not so much.
		First, when testing, I found a corner case I hadn&apos;t anticipated: legacy and otherwise nonstandard item strings.
		My mod doesn&apos;t handle them properly.
		I need to go back and fix that at some point.
		It should be easy with a simple normalisation.
		I&apos;ve also found a way to differentiate things such as coral from things such as cobble.
		Stone can be &quot;crafted&quot;!
		I can run a check in my mod to see if a node is craftable.
		If so, don&apos;t count it, if not, do.
		Supporting coral in this way comes with supporting the harvest of saplings and seeds, too.
		I&apos;d love to have support for these anyway though, just because it balances out the count a bit.
		In its current state, <code>minestats</code> is biased towards miners.
		Surface-dwellers are neglected.
		With support for some plants, people are encouraged both to play underground and in the sunlight.
		One issue could come up though, which is that in the other mod, <code>minequest</code>, automated support for counted nodes and their derivatives would unintuitively not include wooden items.
		Technically, an <abbr title="Active Block Modifier">ABM</abbr> converts saplings into trees, you don&apos;t craft trees from them.
	</p>
	<p>
		At first, it seemed that supporting these new nodes would require introducing some ugly side effects to my mod&apos;s functionality.
		Things such as lit furnaces and open chests (Minetest now has an &quot;open&quot; version of the chest nodes, used when someone accesses their inventory) would end up on the stats page.
		I tried to rationalise it, too.
		I mean, players couldn&apos;t very well harvest open chests on their own, but it two people worked together, it would be possible, right?
		Someone might want to do it just so their stats page would say they had.
		I also thought about checking to see not only if the node was craftable (open chests are not), but also if the drop was craftable.
		However, ruling out open chests and lit furnaces based on the craftability of their drop would also rule out mese, coal, and diamonds, three of the base eight I most want counted.
		I could try checking for presence in the <code>not_in_creative_inventory</code> group, which would almost certainly rule out a bunch of stuff that shouldn&apos;t be counted, but that&apos;d be hacky.
		Besides, it would mean admitting the problem wasn&apos;t actually solvable; that I need a user-specified flag to tell my mod what should and should not be considered worth counting.
		Relying on such a flag would mean throwing in the towel.
		No.
		There will be none of that.
	</p>
	<p>
		However, it turns out that open chests are not only not diggable, they&apos;re also poorly programmed.
		First, there&apos;s the fact that their definition includes what item they drop when dug, but are defined to not be diggable.
		This is ridiculous, and causes a false positive in my mod.
		The fact that they&apos;re undiggable means more than ever though that I need to remove them from the stats page.
		Otherwise, the imposible-to-earn stat just sits there and taunts users.
		But that should be a defining quality I can use to blacklist the open chests, right?
		Yes and no.
		A node that can never be dug should have its <code>diggable</code> property set to <code>false</code>.
		However, the open chests have it set to <code>true</code>.
		Instead, they define their <code>can_dig</code> method to always return <code>false</code>.
		This means I can&apos;t weed them out based on never being diggable, despite the fact that they&apos;re not digabble.
		Instead, I have to weed them out based on the fact that they aren&apos;t necessarily diggable always, but very well could be.
		For my current use case, that&apos;s fine.
		It lets me rule out lit furnaces too, which to be honest, makes my mod&apos;s output look so much cleaner.
		Also, anything that defines a <code>can_dig</code> method is likely unnatural.
		These nodes will either be implementation artefacts, such as is the case with the lit furnace, or will be already ruled out because they&apos;re craftable, like the unlit furnace.
		However, it&apos;s still a poor and non-semantic design choice on the part of whoever coded the open chests.
	</p>
	<p>
		In addition to these other features I want to add, I also want to add support for nodes that drop multiple of the same item.
		Some testing shows the Minetest formspec <abbr title="application programming interface">API</abbr> is up for the task, so with a little more normalisation, I should have that working.
		However, nodes that drop multiple different types of items in the same drop won&apos;t be supported (at least not with first-class stats) as I don&apos;t have a proper way to represent this condition in the database or especially on the stats page.
		I might support them with second-class stats though, allowing people to track their farming activities though.
	</p>
	<p>
		I headed to Chase Bank again to speak with a banker about the paperwork and ask what to do.
		I ended up speaking with the same banker as before.
		Again.
		Are they the only banker in the branch?
		Not that I mind though, after the first repeat.
		It was embarrassing to have to admit I was Alex all along, but today, having them know what was going on already sped up the process.
		The person instructing them over the telephone had told them last time that I needed to fill out paperwork sent to my address, so they were in the same boat as me as far as not being sure why I was sent what I was.
		They asked someone over the telephone again, and it sounds like I don&apos;t need any paperwork after all.
		The banker just needed to fax over a copy of my <abbr title="Department of Motor Vehicles">DMV</abbr> <abbr title="identification">ID</abbr>.
		In seven to ten business days, the change will supposedly be complete in their records.
	</p>
	<p>
		Discover replied, telling me to either fax my documents over or send them via post.
		Um.
		No.
		I replied thusly:
	</p>
	<blockquote>
		<p>
			I can&apos;t send the documents via post, I still need them; unless you&apos;re fine with a copy instead of the original.
			As for the fax, I don&apos;t have a fax machine.
		</p>
	</blockquote>
	<p>
		My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
	</p>
</section>
		<hr/>
		<p>
			Copyright © 2017 Alex Yst;
			You may modify and/or redistribute this document under the terms of the <a rel="license" href="/license/gpl-3.0-standalone.xhtml"><abbr title="GNU&apos;s Not Unix">GNU</abbr> <abbr title="General Public License version Three or later">GPLv3+</abbr></a>.
			If for some reason you would prefer to modify and/or distribute this document under other free copyleft terms, please ask me via email.
			My address is in the source comments near the top of this document.
			This license also applies to embedded content such as images.
			For more information on that, see <a href="/en/a/licensing.xhtml">licensing</a>.
		</p>
		<p>
			<abbr title="World Wide Web Consortium">W3C</abbr> standards are important.
			This document conforms to the <a href="https://validator.w3.org./nu/?doc=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2017%2F06-June%2F05.xhtml"><abbr title="Extensible Hypertext Markup Language">XHTML</abbr> 5.1</a> specification and uses style sheets that conform to the <a href="http://jigsaw.w3.org./css-validator/validator?uri=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2017%2F06-June%2F05.xhtml"><abbr title="Cascading Style Sheets">CSS</abbr>3</a> specification.
		</p>
	</body>
</html>

